import Vue from 'vue'
import VueRouter from 'vue-router'


// import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        // name: 'Main',
        component: () => import('../views/MyMain.vue'),
        children: [
            {
                path: '/',
                name: 'home',
                component: () => import('../views/Home/index.vue')
            },
            {
                path: '/mall',
                name: 'mall',
                component: () => import('../views/Mall/index.vue')
            },
            {
                path: '/user',
                name: 'user',
                component: () => import('../views/User/index.vue')
            },
            {
                path: '/other',
                name: 'other',
                children: [
                    {
                        path: '/page1',
                        name: 'page1',
                        component: () => import('../views/Other/PageOne.vue')
                    },
                    {
                        path: '/page2',
                        name: 'page2',
                        component: () => import('../views/Other/PageTwo.vue')
                    },
                ]
            },
        ]
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('../views/Login/MyLogin.vue')
    },
    // {
    //     path: '/',
    //     name: 'home',
    //     component: () => import('../views/Home/index.vue')
    // },


]
const router = new VueRouter({
    path: '/home',
    mode: 'history',
    routes

})
export default router


